{extend name="common/common"/}
{block name="content"}
<div class="admin-content-body">
    <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">商品</strong> / <small>列表</small></div>
    </div>

    <hr>

    <div class="am-g">
        <div class="am-u-sm-12 am-u-md-6">
            <div class="am-btn-toolbar">
                <div class="am-btn-group am-btn-group-xs">
                    <a href="{:url('goods/add')}" type="button" class="am-btn am-btn-default"><span class="am-icon-plus"></span> 新增</a>
                </div>
            </div>
        </div>
    </div>

    <div class="am-g">
        <div class="am-u-sm-12">
            <form class="am-form">
                <table class="am-table am-table-striped am-table-hover table-main">
                    <thead>
                    <tr>
                        <th class="table-title">商品</th>
                        <th class="table-type">图片</th>
                        <th class="table-id">库存</th>
                        <th class="table-title">分类</th>
                        <th class="table-title">状态</th>
                        <th class="table-date am-hide-sm-only">日期</th>
                        <th class="table-set">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach $result as $vo}
                    <tr>

                        <td>{$vo.title}</td>
                        <td><img width="80px" src="{$vo.head_img}"></td>
                        <td>{$vo.number}</td>
                        <td class="am-hide-sm-only">{$vo.cate_name}</td>
                        <td class="am-hide-sm-only">
                            {$vo.status.text}
                        </td>
                        <td class="am-hide-sm-only">{:date('Y-m-d H:i:s', $vo['create_at'])}</td>
                        <td>
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <a href="{:url('edit', 'id=' . $vo.id)}" class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span> 编辑</a>
                                    <a href="{:url('format', ['id' => $vo['id']])}" class="am-btn am-btn-default am-btn-xs am-hide-sm-only"><span class="am-icon-copy"></span> 规格</a>
                                    <a href="{:url('del', ['id' => $vo['id'], 'type' => 'del'])}" class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"><span class="am-icon-trash-o"></span> 删除</a>
                                </div>
                            </div>
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                <div class="am-cf">
                    <div class="am-fr">
                        <ul class="am-pagination">
                            {$result->render()}
                        </ul>
                    </div>
                </div>
                <hr />
            </form>
        </div>

    </div>
</div>
{/block}